type operateur =
    Plus
  | Moins
  | Mult
  | Div
  

type comparateur = 
    Inf
  | Sup
  | InfEgal
  | SupEgal
  | Egal
  | Diff

type nEntry = {
  mutable entry : int
}

type nArithmetique =
    NN of int
  | NVariable of string * nEntry
  | NUnop of nArithmetique
  | NBinOp of nArithmetique * operateur * nArithmetique

type arithmetiqueListe =
  ArL of nArithmetique list

type appel =
  NAppel of string * arithmetiqueListe

type nInstruction =
    NReturn
  | NReturnValeur of nArithmetique
  | NAffectation of nArithmetique * nArithmetique
  | NAppelMethode of appel
  | NAppelFonction of nArithmetique * appel

type nBoolean =
    NTrue
  | NFalse
  | NCmp of nArithmetique * comparateur * nArithmetique
  | NotBoolean of nBoolean
  | NOr of nBoolean * nBoolean
  | NAnd of nBoolean * nBoolean

type variableListe =
  ListeVariable of nArithmetique list

type nDeclaration =
  NDeclaration of string * variableListe

type declarationsListe = 
  DecList of nDeclaration list  
  
type nStatement =
    NStatementInstruction of nInstruction
  | NIf of nBoolean * nStatement * nStatement
  | NWhile of nBoolean * nStatement
  | NBlock of declarationsListe * statementsListe

and statementsListe =
  nStatement list

type nExpression =
    Na of nArithmetique
  | Nb of nBoolean

type nArgument = 
  NArgument of nArithmetique * string

type argumentsdeclarationListe =
  Al of nArgument list

type nFonction =
  NFonction of string * argumentsdeclarationListe * string * nStatement

type nProcedure =
  NProcedure of string * argumentsdeclarationListe * nStatement

type nProgramme =
    NProgrammeProcedure of nProcedure
  | NProgrammeFonction of nFonction

type nProgrammePrincipal =
  Programme of nProgramme list * nStatement